
<?php
$id_obat=$_POST['id_obat'];
$nama_obat=$_POST['nama_obat'];
$stok=$_POST['stok'];
$harga_beli=$_POST['harga_beli'];
$id_jenis=$_POST['id_jenis'];
$tanggal=$_POST['tanggal'];
$bulan=$_POST['bulan'];
$tahun=$_POST['tahun'];
$detail=$_POST['detail'];
$date=date("Y-m-d");
$satuan=$_POST['satuan'];
$bentuk=$_POST['bentuk'];
$harga_jual=$_POST['harga_jual'];
$aturan=$_POST['aturan'];
$dosis=$_POST['dosis'];
$array_tanggal=array($tanggal,$bulan,$tahun);
echo"<script>alert('$id_obat')</script>";

	$nama_file	=	$_FILES["gambar"]["name"];
		$tipe_file	=	$_FILES["gambar"]["type"];
		$alamat		=	$_FILES["gambar"]["tmp_name"];
		$tujuan		=	"product/$nama_file";
		$gambar		=	move_uploaded_file($alamat, $tujuan);
		if(empty($_FILES["gambar"]["name"])) {
			$gambar_product	=	"substitution_image.jpg";
		} else {
			$gambar_product	=	$_FILES["gambar"]["name"];
		}
$sql="update tbobat set nama_obat='$nama_obat',stok='$stok',tgl_masuk='',harga_beli='$harga_beli',expaired='$tanggal',detail='$detail',gambar='$gambar_product',satuan='$satuan',bentuk='$bentuk',harga_jual='$harga_jual',aturan='$aturan',dosis='$dosis' where id_obat='$id_obat'";
$update=dbQuery($sql)or die(mysql_error());
	if($update){
	?>
	<tr><td colspan="3">&nbsp;</td></tr>
	<tr><td colspan="3" class="judul">&#187 Konfirmasi Update Data Obat</td></tr>
	<tr><td colspan="3" class="jarak_garis"><hr color="#6d6a69"></hr></td></tr>
	<tr><td colspan="3" class="sukses" align="center">Selamat Anda Sukses melakukan update data Obat</td></tr>
	
	<tr><td colspan="3">&nbsp;</td></tr>
	<tr><td colspan="3"><div id="pagging" align="center"><a href="index_admin.php?index=manage_obat&cryption<?=$encode."*upn*".$santra.$random?>">[Kembali]</div></td></tr>
	<tr><td colspan="3">&nbsp;</td></tr>
<?php  }else{
?>
<tr><td colspan="3">&nbsp;</td></tr>
	<tr><td colspan="3" class="judul">&#187 Konfirmasi Input Data Obat</td></tr>
	<tr><td colspan="3" class="jarak_garis"><hr color="#6d6a69"></hr></td></tr>
	<tr><td colspan="3" class="failed" align="center">Maaf Anda Gagal inputkan Data,coba ulangi verifikasi data yang anda inputkan</td></tr>
	<tr><td colspan="3"><a href="index_admin.php?index=manage_obat&cryption=<?=$random."upn".$santra.$encode?>"></td></tr>
	<tr><td colspan="3">&nbsp;</td></tr>
	<tr><td colspan="3">&nbsp;</td></tr>
<?php }


?>